package org.dromara.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.SysFaultInfoEn;
import org.dromara.system.domain.vo.SysFaultInfoEnVo;

import java.util.List;

/**
 * English Fault Information Mapper Interface
 *
 * @author system
 */
public interface SysFaultInfoEnMapper extends BaseMapperPlus<SysFaultInfoEn, SysFaultInfoEnVo> {

    /**
     * Query fault information list with document info by conditions
     *
     * @param excavatorModel Excavator Model
     * @param faultPart     Fault Part
     * @param faultSymptom  Fault Symptom
     * @param faultDetail   Fault Detail
     * @return Fault information list
     */
    List<SysFaultInfoEnVo> selectFaultInfoWithDocList(
        @Param("excavatorModel") String excavatorModel,
        @Param("faultPart") String faultPart,
        @Param("faultSymptom") String faultSymptom,
        @Param("faultDetail") String faultDetail
    );

    /**
     * Get all excavator model list
     *
     * @return Excavator model list
     */
    List<String> selectDistinctExcavatorModels();

    /**
     * Get fault part list by excavator model
     *
     * @param excavatorModel Excavator Model
     * @return Fault part list
     */
    List<String> selectDistinctFaultParts(@Param("excavatorModel") String excavatorModel);

    /**
     * Get fault symptom list by excavator model and fault part
     *
     * @param excavatorModel Excavator Model
     * @param faultPart     Fault Part
     * @return Fault symptom list
     */
    List<String> selectDistinctFaultSymptoms(
        @Param("excavatorModel") String excavatorModel,
        @Param("faultPart") String faultPart
    );

    /**
     * Query fault information detail with document info by fault ID
     *
     * @param faultId Fault ID
     * @return Fault information detail
     */
    SysFaultInfoEnVo selectFaultInfoWithDocById(@Param("faultId") Long faultId);

    /**
     * Count fault referenced by specified solution
     *
     * @param solutionId Solution ID
     * @return Reference count
     */
    int countBySolutionId(@Param("solutionId") Long solutionId);
}

